Repository navigation
fix(quota-plane): publish over-limit Turso windows and preserve dated card metrics (#6227) - #6229
Merged
Merged
Conversation
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 5, 2026 13:38
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6227 — task 10544 (queue repo-health-code-pilot, lane code-t).
Root cause
The live Turso row (source
opencode-quota) carried only databases / rows-written / sync because every layer between the Turso API and the SaaS card dropped or erased the over-limit windows:overlayTursoUsagereplaced the whole card metric set with only the windows a fresh entry carried — so a partial fresh row silently erased the last dated storage / rows-read values.On 2026-11-05 the org was at ~147% of the 5 GB storage limit (7.358009 GB) and ~165% of the monthly rows-read limit (821,437,321) — exactly the state that vanished.
Changes (this PR,
pm-stack/aggregator/)quota-gather-map.ts—entryFromTurso: a finite, non-negative usage-vs-limit ratio above 100 is now kept with its native value and >100pctOfLimit(was: dropped per aggregator: Phase 3 of #2576 — extractor and mapper boundaries on the shared primitives #2579). Non-finite/negative ratios still drop.quota-gather-map.ts—entryFromResult: the same carve-out for the live path, scoped toproviderId === "turso"; every other provider keeps the aggregator(quota-gather-map): entryFromResult and entryFromFileExport never range-check percent — a window at -20% or 1e9% publishes as live ok data and appends as pct history against limit:100 #2571 [0,100] gate.quota-current.ts—overlayTursoUsage: metrics a partial fresh entry does not carry stay on the card with their last dated values, markedstale: last measured <stamp>; absent from the fresh gatherer read at <stamp>— never erased, never presented as fresh, never as proof of recovery.entryFromTursoover-limit fixture using the fix(quota-plane): preserve fresh Turso storage and rows-read measurements #6227 live values;entryFromResultturso carve-out (negative still drops); overlay partial-preservation. Thephase3-boundariesaggregator(quota-gather-map): entryFromTurso never range-checks usage — negative counts publish as live ok data and append negative snapshot records #2553 test that pinned the [0,100] drop forentryFromTursois updated to the fix(quota-plane): preserve fresh Turso storage and rows-read measurements #6227 semantics (finite, >= 0 is the remaining boundary), with the reasoning recorded inline.Companion PR (the set, per the cross-repo rule)
developing-today-forks/opencode: branch
queue/10544-6227-turso-overlimit— the turso provider'spushgate drops only non-finite/negative ratios, so the subcommand publishes storage / rows-read windows above 100% in the first place.Verification
bun test test/quota-gather-map.test.ts test/quota-current.test.ts test/phase3-boundaries.test.ts— 121 pass, 0 fail.main(24 pre-existing failures in unrelated board/source-gate suites, verified by running the suite stashed on clean main: 1436 pass / 24 fail / 2 errors).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.